package com.jxdinfo.hussar.activitidemo.utils;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

public class InterfaceUtilPost {
	public String sendPost(String url, String param) {
		String result = "";
		
		try {
			URL httpurl = new URL(url);
			HttpURLConnection httpConn = (HttpURLConnection) httpurl.openConnection();
			httpConn.setDoOutput(true);
			httpConn.setDoInput(true);
			OutputStreamWriter out = new OutputStreamWriter(httpConn.getOutputStream(),"utf-8");
			out.write(param);
			out.flush();
			out.close();
			BufferedReader in = new BufferedReader(new InputStreamReader(httpConn.getInputStream(),"utf-8"));
			String line;
			while ((line = in.readLine()) != null) {
				result += line;
			}
			in.close();
		} catch (Exception e) {
			System.out.println("Helloword！" + e);
		}
		return result;
	}

}
